import { request } from '@/utils/request.js';

const url = '/adminapi/adminmenu/';

/**
 * 列表
 */
export function apiList(params) {
  return request({
    url: `${url}list`,
    method: 'get',
    params: params,
  });
}

/**
 * 详情
 */
export function apiInfo(params) {
  return request({
    url: `${url}info`,
    method: 'get',
    params: params,
  });
}

/**
 * 保存
 */
export function apiSave(data) {
  return request({
    url: `${url}save`,
    method: 'post',
    data: data,
  });
}

/**
 * 删除
 */
export function apiDel(params) {
  return request({
    url: `${url}delete`,
    method: 'get',
    params: params,
  });
}

/**
 * 启用/禁用
 */
export function apiDisable(data) {
  return request({
    url: `${url}handle`,
    method: 'post',
    data: data,
  });
}

/**
 * 更新排序
 */
export function apiListOrders(params) {
  return request({
    url: `${url}listOrders`,
    method: 'get',
    params: params,
  });
}

/**
 * 复制
 */
export function apiCopy(data) {
  return request({
    url: `${url}copy`,
    method: 'post',
    data: data,
  });
}

/**
 * 树状结构的列表
 */
export function apiTreeList(params = {}) {
  return request({
    url: `${url}treeList`,
    method: 'get',
    params: params,
  });
}
